#include "base.h"



int main(int narg,char **arg)
{

    ccccssss mine;
    ccccssss vicent; 

    int c1,c2,c3,c4,s1,s2,s3,s4;
    double real, imag;

    FILE *f1=fopen(arg[1],"r");
    for (int i=0; i<144*144; i++)
    {
	fscanf(f1,"%i",&c1);
        fscanf(f1,"%i",&c2);
        fscanf(f1,"%i",&c3);
        fscanf(f1,"%i",&c4);

        fscanf(f1,"%i",&s1);
        fscanf(f1,"%i",&s2);
        fscanf(f1,"%i",&s3);
        fscanf(f1,"%i",&s4);

	fscanf(f1,"%lf",&real);
	fscanf(f1,"%lf",&imag);

	mine[c1][c2][c3][c4][s1][s2][s3][s4]=real+I*imag;
    }
    fclose(f1);

    FILE *f2=fopen(arg[1],"r");
    for (int i=0; i<144*144; i++)
    {
        fscanf(f2,"%i",&c1);
        fscanf(f2,"%i",&c2);
        fscanf(f2,"%i",&c3);
        fscanf(f2,"%i",&c4);

        fscanf(f2,"%i",&s1);
        fscanf(f2,"%i",&s2);
        fscanf(f2,"%i",&s3);
        fscanf(f2,"%i",&s4);

        fscanf(f2,"%lf",&real);
        fscanf(f2,"%lf",&imag);

        vicent[c1][c2][c3][c4][s1][s2][s3][s4]=real+I*imag;

    }
    fclose(f2);



      for (int c1=0; c1<3 ; c1++)  for (int s1=0; s1<4 ; s1++)
      for (int c2=0; c2<3 ; c2++)  for (int s2=0; s2<4 ; s2++)
      for (int c3=0; c3<3 ; c3++)  for (int s3=0; s3<4 ; s3++)
      for (int c4=0; c4<3 ; c4++)  for (int s4=0; s4<4 ; s4++)
      {
	 if ( (fabs(creal(mine[c1][c2][c3][c4][s1][s2][s3][s4])-creal(vicent[c1][c2][c3][c4][s1][s2][s3][s4]) ) )<0.00001  && (fabs(cimag(mine[c1][c2][c3][c4][s1][s2][s3][s4])-cimag(vicent[c1][c2][c3][c4][s1][s2][s3][s4]) ) )<0.00001  ) printf("Equal for c1c2c3c4 s1s2s3s4 = %d%d%d%d %d%d%d%d %8.10f I* %8.10f vs %8.10f I*%8.10f\n", c1,c2,c3,c4,s1,s2,s3,s4,creal(mine[c1][c2][c3][c4][s1][s2][s3][s4]),cimag(mine[c1][c2][c3][c4][s1][s2][s3][s4]),creal(vicent[c1][c2][c3][c4][s1][s2][s3][s4]) ,cimag(vicent[c1][c2][c3][c4][s1][s2][s3][s4]));
	 else printf(" Difference for c1c2c3c4 s1s2s3s4 = %d%d%d%d %d%d%d%d %8.10f I* %8.10f vs %8.10f I*%8.10f\n", c1,c2,c3,c4,s1,s2,s3,s4,creal(mine[c1][c2][c3][c4][s1][s2][s3][s4]),cimag(mine[c1][c2][c3][c4][s1][s2][s3][s4]),creal(vicent[c1][c2][c3][c4][s1][s2][s3][s4]) ,cimag(vicent[c1][c2][c3][c4][s1][s2][s3][s4]));
      }

}
